<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<form action="{{url('Admin/article')}}" method="POST" {{--enctype="multipart/form-data" --}}>
    {{csrf_field()}}
<table>
    <div style="background-color: #2ca02c">
        @if(count($errors)>0)
            @if(is_object($errors))
                @foreach($errors->all() as $error)
                    <p>{{$error }}</p>
                @endforeach
            @else
                {{$errors}}
            @endif
        @endif
    </div>
    <tr>
        <th>分类:</th>
        <td><select name="cate_id">
                <option value="0">==顶级分类==</option>


                @foreach($addresoult as $v)

                    <option value="{{$v->cate_id}}">@if($v->cate_pid)┟@endif{{$v->cate_name}}</option>
                @endforeach
            </select><br/></td>
    </tr>
    <tr>
        <th>
            文章标题：
        </th>

        <td> <input type="text" name="art_title" size="50"/><br/></td>
    </tr>
    <tr>
        <th>编辑:</th>
        <td><input type="text" name="art_editor" size="10"/><br/></td>
    </tr>

    <tr>
        <th>
            缩略图:
        </th>
        <td>
            <input type="text" name="art_thumb" size="50"/>
            <input id="file_upload" name="file_upload" type="file" multiple="true">
            <a href="javascript:$('#file_upload').uploadify('upload','*')">上传</a>
            <a href="javascript:$('#file_upload').uploadify('stop')">停止上传</a><br>
            <a href="javascript:$('#file_upload').uploadify('cancel')">取消第一个上传</a>
            <a href="javascript:$('#file_upload').uploadify('cancel', '*')">清除所有</a>

            {{ csrf_field() }}
            <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
            <script src="{{asset('resources/views/org/uploadify/jquery.uploadify.min.js')}}" type="text/javascript"></script>
            <link rel="stylesheet" type="text/css" href="{{asset('resources/views/org/uploadify/uploadify.css')}}">

            <script type="text/javascript">
                <?php $timestamp = time();?>
                $(function() {
                    $('#file_upload').uploadify({
                        'auto' :false ,
                        'buttonText' : '选择图片',
                        'fileTypeDesc'   : '请选择图片，仅支持格式JPG,BMP,PNG,GIF，最大2M',
                        'fileTypeExts': '*.gif; *.jpg; *.png',
                        'fileSizeLimit': "2MB",//上传文件的大小
                        'multi':true,    //一次可选多个文件
                        'uploadLimit'   : 5,  //最大上传文件个数
                     /*   'removeCompleted':false,   //上传厚显示队列*/
                        'formData'     : {
                            'timestamp' : '<?php echo $timestamp;?>',
                            '_token'     : "{{csrf_token()}}"
                        },
                       'swf'      : "{{asset('resources/views/org/uploadify/uploadify.swf')}}",
                        'uploader' : "{{url('Admin/upload' )}}",



                    'onUploadSuccess' : function(file, data, response) {
                 /*   $('input[name=art_thumb]').val(data);*/
                     /*   $('#art_thumb_img1').attr('src','/'+data);*/


                        imgObj="<img src='"+data+"'>";

                          $('#xian').append(imgObj);

                }


                    });
                });
            </script>
            <style>
                .uploadify{display:inline-block;}
                .uploadify-button{border:none; border-radius:5px; margin-top:8px;}
                table.add_tab tr td span.uploadify-button-text{color: #FFF; margin:0;}
            </style>
        </td>

    </tr>

    <tr>
        <th>实时显示图片</th>
        <td>
        <div id="xian">


            </div>

         {{--   <img src="" alt="" id="art_thumb_img1" style="max-width: 350px;max-width: 100px;">--}}

        </td>
    </tr>
    <tr>
        <th>
            关键词：
        </th>
        <td> <textarea name="art_tag" style="width: 100%"></textarea><br/></td>
    </tr>
    <tr>
        <th>
            描述:
        </th>
        <td>
   <textarea name="art_description" style="width: 100%"></textarea>
         <br/>

        </td>
    </tr>

    <tr>
        <th>文章内容:</th>
        <td>
            <script type="text/javascript" charset="utf-8" src="{{asset('resources/views/org/ueditor/ueditor.config.js')}}"></script>
            <script type="text/javascript" charset="utf-8" src="{{asset('resources/views/org/ueditor/ueditor.all.min.js')}}"> </script>
            <script type="text/javascript" charset="utf-8" src="{{asset('resources/views/org/ueditor/lang/zh-cn/zh-cn.js')}}"></script>
            <script id="editor" name="art_content" type="text/plain" style="width:1024px;height:500px;"></script>

            <script type="text/javascript">
                var ue = UE.getEditor('editor');
            </script>
            <br/>

        </td>
    </tr>

    <tr>
        <td>
            <input type="submit" value="提交" style="background-color: #1f648b;" size="50"/>
            <input type="reset" value="返回"/>

        </td>
    </tr>
</table>


</form>
</body>
</html>